//
//  ViewController.m
//  ShopApp
//
//  Created by chenguibang on 17/3/3.
//  Copyright © 2017年 chenguibang. All rights reserved.
//

#import "ViewController.h"
#import <ShopNet/ShopNetTool.h>
#import <BGRoutes/BGRoutes.h>
#import <BGRoutes/UIViewController+BGRouter.h>
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a
    [[ShopNetTool tool]GET:@"http://www.weather.com.cn/data/sk/101010100.html" parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"shou dao");
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
   
    self.view.backgroundColor = [UIColor brownColor];
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
 
    
    NSString *fileName = [[NSBundle mainBundle]pathForResource:@"bgroutes" ofType:@"sqlite"];
    BGRouteManager *ma = [[BGRouteManager alloc]init];
    [ma setUpRulesWithSQLite:fileName];

    
    FMResultSet *set = [ma.fmDatabase executeQuery:@"SELECT * FROM tb_route"];
    // 遍历结果集
    while ([set next]) {
     NSLog(@"路由  : \n%@\n " ,[set resultDictionary]);
    }
    

    
    [self routeTo:@"http://192.168.1.109/shop/getCate" object:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
